package com.hl.card.modular.packBack.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.hl.card.common.persistence.dao.ShortcutsMapper;
import com.hl.card.common.persistence.model.Shortcuts;
import com.hl.card.modular.packBack.service.IShortcutsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author huangpu
 * @since 2018-06-25
 */
@Service
public class ShortcutsServiceImpl extends ServiceImpl<ShortcutsMapper, Shortcuts> implements IShortcutsService {

    @Resource(name = "shortcutsMapper")
    private ShortcutsMapper shortcutsMapper;

    @Override
    public List<Shortcuts> selectList() {
       List<Shortcuts> list = shortcutsMapper.selectList();
       return  list;
    }

    @Override
    public void delete(Integer id) {
      shortcutsMapper.deleteById(id);
    }

    @Override
    public void update(Shortcuts shortcuts) {
       shortcutsMapper.updateById(shortcuts);
    }

    @Override
    public void sava(Shortcuts shortcuts) {
        shortcutsMapper.insert(shortcuts);

    }

    @Override
    public Shortcuts selectById(Integer id) {
        Shortcuts shortcuts = shortcutsMapper.selectById(id);
        return shortcuts;
    }

    @Override
    public Shortcuts selectByCode(String goods_code) {
        Shortcuts shortcuts = shortcutsMapper.selectByCode(goods_code);
        return shortcuts;
    }
}
